using System;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 异常日志数据传输对象
    /// 用于异常日志的数据传输和API交互
    /// </summary>
    public class ExceptionLogDto
    {
        /// <summary>
        /// 异常日志标识符
        /// </summary>
        public long Id { get; set; }
        
        /// <summary>
        /// 跟踪标识符
        /// </summary>
        public string? TraceId { get; set; }
        
        /// <summary>
        /// 关联ID
        /// </summary>
        public string? CorrelationId { get; set; }
        
        /// <summary>
        /// 异常级别
        /// </summary>
        public string ExceptionLevel { get; set; } = string.Empty;
        
        /// <summary>
        /// 异常类型
        /// </summary>
        public string ExceptionType { get; set; } = string.Empty;
        
        /// <summary>
        /// 异常消息
        /// </summary>
        public string ExceptionMessage { get; set; } = string.Empty;
        
        /// <summary>
        /// 堆栈跟踪
        /// </summary>
        public string? StackTrace { get; set; }
        
        /// <summary>
        /// 内部异常
        /// </summary>
        public string? InnerException { get; set; }
        
        /// <summary>
        /// 时间戳
        /// </summary>
        public DateTime Timestamp { get; set; }
        
        /// <summary>
        /// 用户标识符
        /// </summary>
        public string? UserId { get; set; }
        
        /// <summary>
        /// 用户名称
        /// </summary>
        public string? UserName { get; set; }
        
        /// <summary>
        /// 请求路径
        /// </summary>
        public string? RequestPath { get; set; }
        
        /// <summary>
        /// HTTP方法
        /// </summary>
        public string? HttpMethod { get; set; }
        
        /// <summary>
        /// 请求参数
        /// </summary>
        public string? RequestParameters { get; set; }
        
        /// <summary>
        /// IP地址
        /// </summary>
        public string? IpAddress { get; set; }
        
        /// <summary>
        /// 用户代理
        /// </summary>
        public string? UserAgent { get; set; }
        
        /// <summary>
        /// 应用程序名称
        /// </summary>
        public string? ApplicationName { get; set; }
        
        /// <summary>
        /// 服务器名称
        /// </summary>
        public string? ServerName { get; set; }
        
        /// <summary>
        /// 线程ID
        /// </summary>
        public int? ThreadId { get; set; }
        
        /// <summary>
        /// 额外数据
        /// </summary>
        public string? AdditionalData { get; set; }
        
        /// <summary>
        /// 是否已修复
        /// </summary>
        public bool IsFixed { get; set; } = false;
        
        /// <summary>
        /// 修复时间
        /// </summary>
        public DateTime? FixedAt { get; set; }
        
        /// <summary>
        /// 修复说明
        /// </summary>
        public string? FixDescription { get; set; }
        
        /// <summary>
        /// 租户ID
        /// </summary>
        public string? TenantId { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedAt { get; set; }

        /// <summary>
        /// 异常来源
        /// </summary>
        public string? Source { get; set; }

        /// <summary>
        /// 目标站点
        /// </summary>
        public string? TargetSite { get; set; }

        /// <summary>
        /// 帮助链接
        /// </summary>
        public string? HelpLink { get; set; }

        /// <summary>
        /// 异常数据
        /// </summary>
        public string? Data { get; set; }

        /// <summary>
        /// 请求数据
        /// </summary>
        public string? RequestData { get; set; }

        /// <summary>
        /// 修复人员
        /// </summary>
        public string? FixedBy { get; set; }

        /// <summary>
        /// 修复备注
        /// </summary>
        public string? FixNotes { get; set; }
    }
}
